package com.showsu.editor.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.showsu.editor.entity.doo.UserLoginLog;
import com.showsu.editor.entity.po.TblUserLoginLog;

import java.util.Date;

/**
 * @Author: William
 * @Description:
 * @Date: Created in 2:44 下午 2023/3/23
 * @Modified By:
 */
public interface IUserLoginLogService extends IService<TblUserLoginLog> {

    /**
     * 新增会话信息
     * @param userId
     * @param sessionId 会话ID
     * @param loginType 登录类型，0-手机号/验证码登录，1-微信扫码登录
     * @param loginTime
     * @param clientIp
     * @param clientOs
     * @param clientBrowser
     * @param clientOrigin
     * @return
     */
    UserLoginLog save(Long userId, String sessionId, Integer loginType, Date loginTime, String clientIp, String clientOs, String clientBrowser, String clientOrigin);

    /**
     * 用户登出
     * @param sessionId
     * @return
     */
    int logout(String sessionId);

}
